Warp Factor is a simple After Dark™ screen saver module that simulates a warping star field. It's freeware; go ahead and pass it along to friends. Just remember that I retain all rights to the code. If you notice any problems or have any suggestions, drop me a line!
- Todd Bender (tbender@aol.com)
The Controls
• "Warp Factor" affects how fast the stars appear to move. As the warp factor gets higher, the stars stretch and appear to move faster.
• "Stars" determine how many stars to warp; the remaining stars are displayed in the background. The display may appear jerky if too many stars are warping.
• "Point of View" determines your vantage point.
If you select the "port" view, get a hold of John Moltz's Enterprise pictures (AD: 1701s Multimodule on AOL). You can use Warp Factor with the Logo module and his pictures to create the illusion of a ship flying through a warping star field.
• "Star Field Color" determines what color to draw the stars. All stars are drawn in the color you select with the following two exceptions:
1) Setting the star field color to pure black creates a randomly colored star field.
2) Setting the star field color to pure white creates stars that streak into a spectrum.
Version History
• Version 1.0
Initial version.
• Version 1.1
Fixed a bug that messed up the random number generator if the computer was left on for more than a day.
• Version 1.2
Tinkered with the code. This version was never released (except on my machine).
• Version 1.3
Added stars that streak into a spectrum and made the random colored stars brighter.
• Version 1.4
Added a background star field.
A special note for those of you acquainted with ResEdit…
You can change the colors the star will streak into, but it isn't a pretty sight. Someday I hope to create a real interface to this, but for now ResEdit will have to do. Standard warnings pertain to the use of ResEdit. If you don't know what I'm talking about, then don't attempt to do this!
The colors a star will streak into are stored in the "RGBv" resource of Warp Factor. This resource actually contains five color values in the following order:
1) The star field color
2) The first streak color
3) The second streak color
4) The third streak color
5) The fourth streak color
Each color entry is 6 bytes long, 2 bytes for red, 2 bytes for green, and 2 bytes for blue. The entire resource is 30 bytes in size (6 bytes * 5 color entries). To change a streak color, you must:
1) Determine the Red, Green, and Blue portion of the new color.
2) Convert those values to hex.
3) Replace the old hex values with the new ones.
Here's a quick example. Suppose you wanted stars that streak into shades of blue. The initial settings of the "RGBv" resource should look like this:
FFFF FFFF FFFF FFFF
0000 0000 FFFF FFFF
0000 0000 FFFF 0000
0000 0000 FFFF
Try to think of the hex values above as five colors. To illustrate this, I'll break up the values above into five lines. Each line now contains one six-byte color entry:
FFFF FFFF FFFF - Star Color (pure white)
FFFF 0000 0000 - Red
FFFF FFFF 0000 - Yellow
0000 FFFF 0000 - Green
0000 0000 FFFF - Blue
Now replace the red, yellow, and green values with other shades of blue:
FFFF FFFF FFFF
FFFF FFFF FFFF - White
0000 AAAA FFFF - Light Blue
0000 5555 FFFF - Medium Blue
0000 0000 FFFF - Blue
Putting the above values back into their original format, the "RGBv" resource should now look like this:
FFFF FFFF FFFF FFFF
FFFF FFFF 0000 AAAA
FFFF 0000 5555 FFFF
0000 0000 FFFF
All of the streak colors can be replaced with this method; just be careful when making the modifications. Also, please don't pass on modified versions of Warp Factor (unless they're ultra-cool and the person wants it, in which case you should e-mail me the combination so I could check it out). Note that I can't be held responsible if you explode your computer attempting to make cool streak colors!